#pragma once
#include <ui/multi_lang.h>
#include <interface/xml_parser_interface.h>
#include <Util/WinAPITools.h>
#include "dll_object.h"
#include "resource.h"

class multi_lang_impl : public multi_lang
{
public:
	multi_lang_impl(){}
	~multi_lang_impl(){}

	bool init()
	{
		if ( !g_dll_obj->im_->query_interface(this->res_str_parser_, "ires_parser") )
		{
			return FALSE;
		}
		std::string xml_fn = _UTIL::GetModulePath(AfxGetInstanceHandle()) 
			+ "language\\2052\\res_string.xml";

		if ( !this->res_str_parser_.open(xml_fn.c_str()) )
		{
			return FALSE;
		}

		insert_res_string("IDD_BALANCE_WARNING", IDD_BALANCE_WARNING);
		insert_res_string("IDC_BALANCE_NOTIFY", IDC_BALANCE_NOTIFY);
		insert_res_string("IDC_BTN_RECHARGE", IDC_BTN_RECHARGE);
		insert_res_string("IDC_BTN_CLOSE",IDC_BTN_CLOSE );
//		insert_res_string("IDC_STATIC_TITLE", IDC_STATIC_TITLE);
//		insert_res_string("IDC_BTN_ADD", IDC_BTN_ADD);
		insert_res_string("IDC_BTN_INVITE", IDC_BTN_INVITE);
		insert_res_string("IDC_BTN_CLICKOUT", IDC_BTN_CLICKOUT);
		insert_res_string("IDC_BTN_ALLOWSPEEK", IDC_BTN_ALLOWSPEEK);
		insert_res_string("IDC_BTN_NOTSPEEK", IDC_BTN_NOTSPEEK);
		insert_res_string("IDC_BTN_TALKSECRECT_CANCEL", IDC_BTN_TALKSECRECT_CANCEL);
		insert_res_string("IDC_BTN_STOP_RECORD", IDC_BTN_STOP_RECORD);
		insert_res_string("IDC_BTN_START_RECORD", IDC_BTN_START_RECORD);
		insert_res_string("IDC_BTN_TALKSECRECT", IDC_BTN_TALKSECRECT);
		insert_res_string("IDC_BTN_QUIT", IDC_BTN_QUIT);
		insert_res_string("IDD_DLG_MEETING_ROOM", IDD_DLG_MEETING_ROOM);
		insert_res_string("IDC_TIME",IDC_TIME );
		insert_res_string("IDC_MEETING_NUM", IDC_MEETING_NUM);
		insert_res_string("IDC_STATIC_PUTNUMBER", IDC_STATIC_PUTNUMBER);
		insert_res_string("IDC_BTN_INVITETOMEETING", IDC_BTN_INVITETOMEETING);
		insert_res_string("IDC_STATIC_NOTIFY1", IDC_STATIC_NOTIFY1);
		insert_res_string("IDC_STATIC_NOTIFY2", IDC_STATIC_NOTIFY2);
		insert_res_string("IDS_MEETING_LIST", IDS_MEETING_LIST);
		insert_res_string("IDS_RESERVE_MEETING", IDS_RESERVE_MEETING);
		insert_res_string("IDS_USER_NAME", IDS_USER_NAME);
		insert_res_string("IDC_STATIC_INPUT_PHONE", IDC_STATIC_INPUT_PHONE);
		insert_res_string("IDOK", IDOK);
		insert_res_string("IDS_PLEASE_START_MEETING", IDS_PLEASE_START_MEETING);
		insert_res_string("IDS_CNNT_DIS", IDS_CNNT_DIS);
		insert_res_string("IDS_PRESIDER", IDS_PRESIDER);
		insert_res_string("IDS_WAITING", IDS_WAITING);
		insert_res_string("IDC_STATIC_NOTIFY3", IDC_STATIC_NOTIFY3);

		insert_res_string("IDS_SPEAK", IDS_SPEAK);
		insert_res_string("IDS_CONTRL", IDS_CONTRL);
		insert_res_string("IDS_STATUS", IDS_STATUS);
		insert_res_string("IDS_CALL_FAILED",IDS_CALL_FAILED );
		insert_res_string("IDS_TELECONFERENCE", IDS_TELECONFERENCE);
		insert_res_string("IDS_LISTEN_FAILED", IDS_LISTEN_FAILED);
		insert_res_string("IDS_CALL_FAIED_2", IDS_CALL_FAIED_2);
		insert_res_string("IDS_SURE_HANDUP", IDS_SURE_HANDUP);
		insert_res_string("IDS_WAITTING", IDS_WAITTING);
		insert_res_string("IDS_CALLING", IDS_CALLING);
		insert_res_string("IDS_SPEEK_AND_LISTEN", IDS_SPEEK_AND_LISTEN); 
		insert_res_string("IDS_LISTEN", IDS_LISTEN);
		insert_res_string("IDS_SECRECT_CHAT", IDS_SECRECT_CHAT);  
		insert_res_string("IDS_HANDUP", IDS_HANDUP);  
		insert_res_string("IDS_SURE_STOP_DOWNLOAD_RECORD", IDS_SURE_STOP_DOWNLOAD_RECORD);
		insert_res_string("IDS_PLEASE_INPUT_PHONE_NUM", IDS_PLEASE_INPUT_PHONE_NUM);
		insert_res_string("IDS_NOT_SAME_TO_PRESIDER", IDS_NOT_SAME_TO_PRESIDER);
		insert_res_string("IDS_PHONE_EXIST", IDS_PHONE_EXIST);
		insert_res_string("IDS_SURE_INVITE", IDS_SURE_INVITE);
		insert_res_string("IDS_ADD_MEMBER_FAILED", IDS_ADD_MEMBER_FAILED);
		insert_res_string("IDS_ADD_SB_FAILED", IDS_ADD_SB_FAILED);
		insert_res_string("IDS_ADD_TO_SERVER_FAILED", IDS_ADD_TO_SERVER_FAILED);
		insert_res_string("IDS_REPEAT_NUMBER",IDS_REPEAT_NUMBER );
		insert_res_string("IDS_RE_CALL", IDS_RE_CALL);
		insert_res_string("IDS_PELEASE_SELECT_ONE",IDS_PELEASE_SELECT_ONE );
		insert_res_string("IDS_SURE_LET_SPEAK", IDS_SURE_LET_SPEAK);
		insert_res_string("IDS_SURE_LET_STOP_SPEAK", IDS_SURE_LET_STOP_SPEAK);
		insert_res_string("IDS_SURE_CANCEL_SECRECT_TALK", IDS_SURE_CANCEL_SECRECT_TALK);
		insert_res_string("IDS_SURE_TALK_SECRECT_TO", IDS_SURE_TALK_SECRECT_TO);
		insert_res_string("IDS_SURE_CLICK_OUT", IDS_SURE_CLICK_OUT);
		insert_res_string("IDS_DELETE_FAILED", IDS_DELETE_FAILED);
		insert_res_string("IDS_SURE_QUIT_OUT", IDS_SURE_QUIT_OUT);
		insert_res_string("IDS_THIS_MEETING_EXIST",IDS_THIS_MEETING_EXIST );
		insert_res_string("IDS_MEETING_NUM", IDS_MEETING_NUM);
		insert_res_string("IDS_DEFAULT_PWD", IDS_DEFAULT_PWD);
		insert_res_string("IDS_CREATE_MEETING", IDS_CREATE_MEETING);
		insert_res_string("IDS_GET_MEETING_NUM_FAILED", IDS_GET_MEETING_NUM_FAILED);
		insert_res_string("IDS_LIST_MEETING_NUMBER", IDS_LIST_MEETING_NUMBER);
		insert_res_string("IDS_LIST_MEETING_TITLE", IDS_LIST_MEETING_TITLE);
		insert_res_string("IDS_LIST_MEETING_TIME",IDS_LIST_MEETING_TIME );
		insert_res_string("IDS_LIST_MEETING_STATUS", IDS_LIST_MEETING_STATUS); 
		insert_res_string("IDS_LIST_MEETING_RECORD", IDS_LIST_MEETING_RECORD);
		insert_res_string("IDS_SURE_DELETE_MEETING", IDS_SURE_DELETE_MEETING);
		insert_res_string("IDS_SELECT_ONE_UPDATE", IDS_SELECT_ONE_UPDATE);
		insert_res_string("IDS_GET_MEETING_PARAM_FAILED", IDS_GET_MEETING_PARAM_FAILED);
		insert_res_string("IDS_GET_MEETING_LIST_FAILED",IDS_GET_MEETING_LIST_FAILED );
		insert_res_string("IDS_DOWNLOAD_RECORD_FILE_FAILED", IDS_DOWNLOAD_RECORD_FILE_FAILED);
		insert_res_string("IDS_MEETING_UN_BEGIN", IDS_MEETING_UN_BEGIN);
		insert_res_string("IDS_IN_MEETING", IDS_IN_MEETING);
		insert_res_string("IDS_MEETING_EXIT", IDS_MEETING_EXIT);
		insert_res_string("IDS_BLANCE_LESS", IDS_BLANCE_LESS);
		insert_res_string("IDS_GET_STATUS_FAILED", IDS_GET_STATUS_FAILED);
		insert_res_string("IDS_GET_DOWNLOAD_URL_FAILED",IDS_GET_DOWNLOAD_URL_FAILED );
		insert_res_string("IDS_DELETE", IDS_DELETE);
		insert_res_string("IDS_TITLE_NOT_EMPTY", IDS_TITLE_NOT_EMPTY);
		insert_res_string("IDS_MEETING_TIME_LESS_CUR_TIME", IDS_MEETING_TIME_LESS_CUR_TIME);
		insert_res_string("IDS_UPDATE_MEETING_FAILED", IDS_UPDATE_MEETING_FAILED);
		insert_res_string("IDS_RESERVE_MEETING_FAILED", IDS_RESERVE_MEETING_FAILED);
		insert_res_string("IDS_THE_PHONE_EXIST", IDS_THE_PHONE_EXIST);
		insert_res_string("IDS_GET_MEETING_MEMBER_LIST_FAILED",IDS_THE_PHONE_EXIST );
		insert_res_string("IDS_INPUT_NUMBER_EXIST", IDS_INPUT_NUMBER_EXIST);
		insert_res_string("IDS_PLEASE_BIND_PHONE", IDS_PLEASE_BIND_PHONE);
		insert_res_string("IDS_SERV_ERRO", IDS_SERV_ERRO);
		insert_res_string("IDS_BALANCE", IDS_BALANCE);
		return TRUE;
	}

private:
	bool insert_res_string(const char* id, int string_def)
	{
		std::string val = this->res_str_parser_.get_string(id, "");
		return insert_res_string_i(val.c_str(), string_def);
	}

	aot::tt::res_parser_string_helper res_str_parser_;

};

